package com.share.bean.attach.advertise;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * <p>
 * Title：文本、代码、页面广告
 * </p>
 * <p>
 * Description：
 * </p>
 * 
 * @Author：杨浩泉
 * @Date：2010-4-24
 */
@Entity
@Table(name = "share_adContext")
public class AdvertiseContext {

	/** 广告内容ID */
	private int adContentId;

	/** 广告文本或代码以及页面内容 */
	private String adContent;

	/** 文本广告内容与广告列表一对一关联关系，被维护 */
	private Advertise advertisement;

	@OneToOne(mappedBy = "adContext", cascade = CascadeType.REFRESH)
	@JoinColumn(name = "adContext_id")
	public Advertise getAdvertisement() {
		return advertisement;
	}

	public void setAdvertisement(Advertise advertisement) {
		this.advertisement = advertisement;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	public int getAdContentId() {
		return adContentId;
	}

	public void setAdContentId(int adContentId) {
		this.adContentId = adContentId;
	}

	public String getAdContent() {
		return adContent;
	}

	public void setAdContent(String adContent) {
		this.adContent = adContent;
	}

}
